﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Manage_Service_addKnowledge : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {
        if (!IsPostBack) {
            if (Request.Form["kname"] != null || Request.Form["kname"].Trim() != "") {
                string reqStr = Request.Form["kname"].Trim(',');
                if (Request.Form["cid"] != null || Request.Form["cid"].Trim() != "") {
                    int cid = int.Parse(Request.Form["cid"].Trim());
                    string resu = AddKnowledge(reqStr,cid);
                    Response.Write(resu);
                    Response.End();
                }
            }

        }
    }

    private string AddKnowledge(string reqStr, int cid) {
        string result = "0";
        //查询是否已经存在该知识点


        if (new Exam.Core.DAL.Knowledge().Add(reqStr, cid)) {
            result = "1";
        }
        return result;
    }
}
